\section{Example}

\begin{lstlisting}
	// Declarations from DAVE3 Code Generation
#include <DAVE3.h>
#include "N25Q032A.h"
#include "hybrid_ftl.h"

#define ARRAYLENGTH	4096

	//buffer for transmit data
uint16_t pSendData[ARRAYLENGTH];
	//buffer for receive data
uint16_t pReadData[ARRAYLENGTH];

int main(void)
{
	FTL001_StatusType w_status;
	FTL001_StatusType r_status;
	FTL001_StatusType i_status;
	FTL001_Handler FHandler;
		// Initialization of DAVE apps
	DAVE_Init();

		// Allocate low-level-functions
	FHandler.ReadID = N25Q032A_RDID;
	FHandler.ProgramPage = N25Q032A_QuadWrite_PAGE;
	FHandler.WriteEnable = N25Q032A_WriteEnable;
	FHandler.ReadStatus = N25Q032A_STATUS_RD;
	FHandler.ReadPage = N25Q032A_QuadRD_PAGE;
	FHandler.SectorErase = N25Q032A_Sector_Erase;
	FHandler.ConfigureStandard = N25Q032A_Std_Config;
		//Register handler
	FTL001_RegisterHandler(&FTL001_Handle0, &FHandler);

	FTL001_CFIInfoType CFIInfo;
		// Read CFI-information
	FTL001_GetCFIInfo(&FTL001_Handle0, &CFIInfo);
		// Initialize Emulation System
	i_status = Fee_init();

		// Fill in some data
	pSendData[0] = 69;
	pSendData[1] = 96;
	pSendData[3] = 128;
		// Write data
	w_status = Fee_write(0x010203, &pSendData[0], ARRAYLENGTH);
		// Read data
	r_status = Fee_read(0x010203, &pReadData[0], ARRAYLENGTH);

	int i;
		// Check if data was right
	for (i=0; i<ARRAYLENGTH; i++) {
		if (pReadData[i] != pSendData[i]) {
			// ERROR!
		}
	}
	
	while(1)
		asm("Nop");	//do nothing

	return 0;
}
\end{lstlisting}